from rest_framework.response import Response as _

class Response(_):
    def __init__(self, code=200, msg='操作成功', data=None,headers=None, exception=False,**kwargs):

        ret_data = {
            'code':code,
            'msg':msg,
        }
        if data:
            ret_data['result'] = data

        super().__init__(
            data=ret_data,status=200,
            headers=headers,exception=exception,
        )



